package view;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.WindowConstants;
import javax.swing.JFrame;
import javax.swing.JLabel;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class JuegoFeedbackNoGano extends javax.swing.JPanel {
	private static JuegoFeedbackNoGano instancia;
	private JButton cerrar;
	private JLabel jLabel1;

	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.getContentPane().add(new JuegoFeedbackNoGano());
		frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		frame.pack();
		frame.setVisible(true);
	}
	
	private JuegoFeedbackNoGano() {
		super();
		initGUI();
	}
	
	public static JuegoFeedbackNoGano getInstance() {
		if (instancia == null) {
			instancia = new JuegoFeedbackNoGano();
		}
		return instancia;
	}
	
	private void initGUI() {
		try {
			this.setPreferredSize(new java.awt.Dimension(400, 138));
			this.setLayout(null);
			this.add(getJLabel1());
			this.add(getCerrar());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private JLabel getJLabel1() {
		if(jLabel1 == null) {
			jLabel1 = new JLabel();
			jLabel1.setText("Mm nada.. Mejor suerte la proxima!");
			jLabel1.setBounds(21, 27, 355, 48);
			jLabel1.setFont(new java.awt.Font("Dialog",0,20));
		}
		return jLabel1;
	}
	
	private JButton getCerrar() {
		if(cerrar == null) {
			cerrar = new JButton();
			cerrar.setText("Cerrar");
			cerrar.setBounds(172, 87, 51, 22);
			cerrar.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					Juego.getInstance().cerrarVentanaDeFeedback();
				}
			});
		}
		return cerrar;
	}

}
